package com.zy.paratest.controller;

import com.zy.paratest.properties.person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class personcontroller {

    //    @Value("${person.name}")
//    private String name;
//
//    @Value("${person.age}")
    //    private Integer age;
    @Autowired
    private person ilperson;

    //    @PathVariable("iname") 通过url路径来传递参数，如：/hi/zhangsan
//    @RequestParam("name")  通过变量赋值的方式传递
//    @RequestMapping(value = "/hi",method = RequestMethod.GET)
    @GetMapping(value = "/hi")
    public String person(@RequestParam(value = "name", defaultValue = "0", required = false) String iname) {
        return "person name is :" + iname;
//        return ilperson.getName() + ilperson.getAge() + ilperson.getHeight() + ilperson.getWeight();
    }

}
